package com.zyj.test.month1.day1;

/**
 * @author Yijia Zhang
 * @create 2023-11-02 00:30
 */
public class code2103 {
    public int countPoints(String rings) {
        int[] map = new int[10];
        int len = rings.length();
        for (int i = 0; i < len; i++) {
            if (i % 2 == 0) {
                char colorChar = rings.charAt(i);
                char numChar = rings.charAt(i + 1);
                int numInt = numChar - '0';
                switch(colorChar) {
                    case 'R':
                        map[numInt] |= 1;
                        break;
                    case 'G':
                        map[numInt] |= 2;
                        break;
                    case 'B':
                        map[numInt] |= 4;
                        break;
                }
            }
        }
        int cnt = 0;
        for (int i = 0; i < 10; i++) {
            if (7 == map[i]) {
                cnt++;
            }
        }
        return cnt;
    }

    public void test(int a , int b) {

    }
}
